]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appIcon: Remove drag monitor on destroy
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 21 Nov 2019 21:50:11 +0000 (18:50 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 21 Nov 2019 22:28:46 +0000 (22:28 +0000)
It may happen that the app icon is destroyed with a drag
monitor still around, in which case, a load of warnings
will be shown.

Make sure to remove any pending drag monitor on destroy.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841

js/ui/appDisplay.js

index bc411b0293d333e45b775a801a25ac10b4ef10cd..929caa12bd49308102c897174aedb6328b62c535 100644 (file)
@@ -2133,6 +2133,7 @@ var AppIcon = GObject.registerClass({
             });
         }
 
+        this._dragMonitor = null;
         this._itemDragBeginId = Main.overview.connect(
             'item-drag-begin', this._onDragBegin.bind(this));
         this._itemDragEndId = Main.overview.connect(
@@ -2157,6 +2158,12 @@ var AppIcon = GObject.registerClass({
         }
         if (this._stateChangedId > 0)
             this.app.disconnect(this._stateChangedId);
+
+        if (this._dragMonitor) {
+            DND.removeDragMonitor(this._dragMonitor);
+            this._dragMonitor = null;
+        }
+
         if (this._draggable) {
             if (this._dragging)
                 Main.overview.endItemDrag(this);